<?php


namespace app\api\controller\mall;


use app\api\controller\Auth;
use app\common\business\Cart;
use app\common\lib\Show;

class Init extends Auth
{
    public function index()
    {
        if (!request()->isPost()) {
            return Show::error();
        }

        $count = (new Cart())->getCount($this->user_id);
        return Show::success([
            'count' => intval($count),
        ]);
    }

}